using UnityEditor;
using UnityEngine;
using UnityEngine.UI;
using System.Diagnostics;
using UI = SgsUI.Editor.UI;

namespace SgsUI.Editor{
    static internal class MenuItemInsert{
        [MenuItem("GameObject/SgsUI/Canvas", false, 10)]
        static public void AddCanvas(MenuCommand menuCommand)
        {
            var go = UI.CreateNewUI();
            UIUtility.SetParentAndAlign(go, menuCommand.context as GameObject);
            Selection.activeGameObject = go;
        }

        [MenuItem("GameObject/SgsUI/ccNode &n", false, 11)]
        static public void AddNode(MenuCommand menuCommand)
        {
            GameObject go = UI.CreateNode();
            UIUtility.PlaceUIElementRoot(go,menuCommand);
        }

        [MenuItem("GameObject/SgsUI/ccSprite &s", false, 12)]
        static public void AddImage(MenuCommand menuCommand)
        {
            GameObject go = UI.CreateSprite();
            UIUtility.PlaceUIElementRoot(go,menuCommand);
        }

        [MenuItem("GameObject/SgsUI/ccLabel &t", false, 13)]
        static public void AddText(MenuCommand menuCommand)
        {
            GameObject go =  UI.CreateLabel();
            UIUtility.PlaceUIElementRoot(go,menuCommand);
        }

        [MenuItem("GameObject/SgsUI/Button &b",false,14)]
        static public void AddSimpleButton(MenuCommand menuCommand)
        {
            GameObject go =  UI.CreateButton();
            UIUtility.PlaceUIElementRoot(go,menuCommand);
        }
    }
}